using System;
using System.Runtime.Remoting.Contexts;

namespace SDG.UnitTesting
{
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
    public class SDGExecuteAttribute : ContextAttribute
    {
        private const string _Name = "Red Gate SDG";
        
        private string _project;
        public string Project
        {
            get { return _project; }
            set { _project = value; }
        }

        public SDGExecuteAttribute(string projectFileName) : base(_Name)
        {
            Project = projectFileName;
        }

        public void Execute(string pathToExe)
        {
            SDGConsoleWrapper cons = new SDGConsoleWrapper(pathToExe, Project);
            cons.Execute();
        }
    }
}